{extend name='admin@public/content'}

{block name="button"}

<!--{if auth("$classuri/add")}-->
<button data-open='{:url("$classuri/add")}?type={$type}' data-title="添加抽奖" class='layui-btn layui-btn-sm'>添加抽奖</button>
<!--{/if}-->

{/block}


{block name="content"}
<!-- 表单搜索 开始 -->

<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <!--{if empty($list)}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td'>
                <input data-auto-none="none" data-check-target='.list-check-box' type='checkbox'/>
            </th>
            <th class='text-left'>奖品ID</th>
            <th class='text-left'>奖品名称</th>
            <th class='text-left'>剩余数量</th>
            <th class='text-left'>中奖数量</th>
            <th class='text-left'>中奖提示</th>
            <th class='text-left'>中奖跳转连接</th>
            <th class='text-left'>中奖概率</th>
            <th class='text-left'>是否加入抽奖</th>
            <th class='text-left'>奖品类型</th>
            <th class='text-left'>添加时间</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'/>
            </td>
            <td class='text-left'>
                {$vo.id}
            </td>
            <td class='text-left nowrap'>
                <img data-tips-image class="headimg" src="{$vo.original_img}"/>
                {$vo.goods_name|default=''}
            </td>
            <td class='text-left'>
                {if $vo.goods_name neq '谢谢惠顾'}
                {$vo.goods_num|default='0'}
                {else/}
                无限
                {/if}
            </td>
            <td class='text-left'>
                {if $vo.goods_name neq '谢谢惠顾'}
                {$vo.lottery_num|default='0'}
                {else/}
                -
                {/if}
            </td>

            <td class='text-left nowrap'>
               {$vo.copywriter2|default=''}
            </td>
            <td class='text-left nowrap'>{$vo.href|default=''}</td>
            <td class='text-left nowrap'>{$vo.rate|default=0}%</td>
            <td class='text-left nowrap'>{$vo.status==1?'是':'否'}</td>
            <td class='text-left nowrap'>{$vo.type==1?'高级':'普通'}</td>
            <td class='text-left nowrap'>{$vo.addtime|date="Y-m-d H:i:s"}</td>

            <td class="text-center nowrap">
                {if auth("$classuri/edit")}
                <span class="text-explode">|</span>
                <a data-title="编辑用户" data-modal='{:url("$classuri/edit")}?id={$vo.id}&type={$type}'>编辑</a>
                {/if}

                {if auth("$classuri/improt_cdk")}
                    {if $vo.goods_name neq '谢谢惠顾'}
                        <span class="text-explode">|</span>
                        <a data-title="导入CDKey" data-modal='{:url("$classuri/improt_cdk")}?id={$vo.id}'>导入CDKey</a>
                    {/if}
                {/if}

                {if $vo.status eq 1 and auth("$classuri/forbid")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/forbid")}'>禁用</a>
                {elseif auth("$classuri/resume")}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/resume")}'>启用</a>
                {/if}

                {if auth("$classuri/del")}
                {if $vo.goods_name neq '谢谢惠顾'}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'>删除</a>
                {/if}
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/if}-->
</form>
{/block}

{block name="script"}
<!--表单初始化-->
<script>
    window.laydate.render({range: true, elem: '#create_at'});
    window.form.render();
</script>
<style>
    .headimg {
        width: 25px;
        height: 25px;
        border-radius: 50%;
        margin-right: 10px;
    }

    .add-tag {
        font-size: 12px;
        font-weight: 400;
        border-radius: 50%;
        color: #333;
        background: #eee;
        border: 1px solid #ddd;
    }

    .add-tag:hover {
        color: #000 !important;
        border: 1px solid #ccc;
    }

</style>
{/block}
